/*************************************************************************
	> File Name: oj-487.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2021年02月03日 星期三 22时48分02秒
 ************************************************************************/
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
    ll n, f[3] = {0, 2, 2};
    cin >> n;
    for (int i = 3; i <= n; ++i) {
        f[i % 3] = f[(i - 1) % 3] + f[(i - 2) % 3];
    }
    cout << f[n % 3] << endl;
    return 0;
}
